<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/1/24
 * Time: 16:12
 */

namespace App\Models;
use App\Models\TranslateRecord;
use Illuminate\Database\Eloquent\Model;

class TranslateImprovedRecord extends Model
{
    //STATUS
    CONST STATUS_NOT_AUDIT = 1;
    CONST STATUS_AUDIT_PASS = 2;
    CONST STATUS_AUDIT_NOT_PASS = 3;

    protected $fillable = [
        'translate_record_id',
        'status',
        'translate_text',//markdown译文
        'translator_id',
        'auditor',
    ];

    public $timestamps = true;

    public function translateRecord()
    {
        return $this->belongsTo(TranslateRecord::class, 'translate_record_id', 'id');
    }

    public function user()
    {
        return $this->belongsTo(User::class, 'translator_id', 'id');
    }

    public function setAttributes($attrs)
    {
        self::update($attrs);
    }


}